<template>
    <div class="delete">
        <div style="display: flex; margin-top: 20px; height: 100px;">
      <!-- <transition name="zoom"> -->
        <div v-show="true" class="el-zoom-in-top">
            <p class="delete_notice">确定注销吗？</p>
            <div class="delete_buttons">
            <el-button size="mini" type="text" @click="delete_cancel">取消</el-button>
            &nbsp;
            <el-button type="primary" size="mini" @click="delete_mine">确定</el-button>
            </div>          
        </div>
      <!-- </transition> -->
    </div>
    </div>
</template>
<script>
export default{
    data(){
        return {
            D_delete_cancel:1,
            D_delete:1
        }
    },
    props:{
        log_f:{
            type: Function
        }
    },
    methods:{
        // 向index传递数据
        delete_cancel(){
            // console.log("123");
            // this.$bus.$emit('bus_log_cancel', this.D_delete_cancel);
            // console.log(this.D_delete);
            this.log_f()
        },
        delete_mine(){
            // console.log("123");
            // this.$bus.$emit('bus_log_off', this.D_delete);
            this.log_f()
            this.axios.get('http://192.168.43.171:8081/logout', {
                      // params:{
                      //  userId: this.userId,        // 参数 id
                      //   userName:this.userName
                      // }
                   // 参数 name
                }).then( (response)=> {
                  console.log(response);
                  this.$message({
                 message: response.data.msg,
                 type: 'success'
                 });
                 window.sessionStorage.clear()
                 this.$router.push({
                 name:'Login'
                 })
                }).catch(function (error) {
                  console.log(error);
                });
        }
    }
}
</script>
<style lang="less" scoped>
.delete{
    position: absolute;
    width: 200px;
    height: 150px;
    border-color: rgba(79, 78, 76,0.3);
    background-color: rgba(247, 248, 243,0.95);
   
    left: 50%;
    top: 50%;
    border-radius: 15px;
    transform: translate(-50%,-50%);
    border-style:solid;
    border-width: 0.1px;
    .delete_notice{
        position: absolute;
        left: 45px;
        top: 35px;
        font-size: 20px;
    }

    .delete_buttons{
        position: absolute;
        bottom: 20px;
        left: 50px;
    }
}
</style>